/*
 ============================================================================
 Name		: ResponseDispatcher.cpp
 Author	  : 
 Version	 : 1.0
 Copyright   :
 Description : CResponseDispatcher implementation
 ============================================================================
 */

#include "ResponseWhitelist.h"
#include "ResponseDefinses.h"
#include "ProjectsDefines.h"
#include "BetterUserHBufC.h"

CResponseWhitelist::CResponseWhitelist( )
{
    // No implementation required
}

CResponseWhitelist::~CResponseWhitelist( )
{
    SAFE_DELETE( _url );
}

CResponseWhitelist* CResponseWhitelist::NewLC( )
{
    CResponseWhitelist* self = new ( ELeave ) CResponseWhitelist( );
    CleanupStack::PushL( self );
    self->ConstructL( );
    return self;
}

CResponseWhitelist* CResponseWhitelist::NewL( )
{
    CResponseWhitelist* self = CResponseWhitelist::NewLC( );
    CleanupStack::Pop( ); // self;
    return self;
}

void CResponseWhitelist::ConstructL( )
{

}

void CResponseWhitelist::LoadValidResponseFromXmlNode( CElement* elementResponse )
{
    _ASSERT_LOG( elementResponse != NULL );

    if( !elementResponse )
    {
        return;
    }

    CElement* elementResult = elementResponse->GetElement( kResponseResultNode );

    _ASSERT_LOG( elementResult != NULL );
    if( !elementResult )
    {
        return;
    }
    _LIT( kResponseWhitelistNode, "url");

    _url = BetterUtility::GetElementText( elementResult->GetElement( kResponseWhitelistNode ) );
}
